#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
// 2 4 8 10 -> 2 4 5 8 -> 2 4 4 -> 2 2 4
// 11 5 -> 16 + 8
int main() {
    int n = 0, k = 0;
    cin >> n >> k;
    vector<long long> v(n);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }

    long long sum = 0;
    priority_queue<long long> pq;
    for (auto& e : v) {
        if (e % 2 == 0) {
            pq.push(e);
        }
        else {
            sum += e;
        }
    }
    // cout << pq.top() << endl;
    while (k-- && !pq.empty()) {
        long long top = pq.top() / 2;
        pq.pop();
        if (top % (long long)2 == 0) {
            pq.push(top);
        }
        else {
            sum += top;
            // cout << pq.top() << endl;
        }
    }
    while (!pq.empty()) {
        sum += pq.top();
        pq.pop();
    }
    cout << sum << endl;
    return 0;
}